package com.qiqi.system_settings.controller;

import com.qiqi.pojo.SyCostType;
import com.qiqi.system_settings.server.SyCostTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController

public class SyCostTypeController {
    @Autowired
    private SyCostTypeService SyCostTypeService;

    /**
     * 全查
     * @return
     */
    @GetMapping("system/queryAllSyCostType")
    public List<SyCostType> queryAll(){
        return SyCostTypeService.queryAll();
    }
    /**
     * 全查2
     * @return
     */
    @GetMapping("system/queryAllFWSyCostType")
    public List<SyCostType> queryAllFW(){
        return SyCostTypeService.queryAllFW();
    }

    /**
     * 添加
     * @param area
     * @return
     */
    @PostMapping("system/saveSyCostType")
    public int save(SyCostType area){
        return SyCostTypeService.save(area);
    }

    /**
     * 修改
     * @param area
     * @return
     */
    @PutMapping("system/updateSyCostType")
    public int update(SyCostType area){
        return SyCostTypeService.update(area);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @DeleteMapping("system/delSyCostType")
    public int del(int id){
        return SyCostTypeService.del(id);
    }
    /**
     * 删除2
     * @param id
     * @return
     */
    @DeleteMapping("system/delDisableSyCostType")
    public int delDisable(int id){
        return SyCostTypeService.delDisable(id);
    }

    /**
     * 根据id查询
     * @param id
     * @return
     */
    @GetMapping("system/queryByidSyCostType")
    public SyCostType queryByid(int id){
        return SyCostTypeService.queryByid(id);
    }

}
